import datetime
import zipfile


def get_datetime(year, day_of_year):
    first_day = datetime.datetime(year, 1, 1)
    zone = datetime.timedelta(days=day_of_year - 1)

    return datetime.datetime.strftime(first_day + zone, "%Y-%m-%d")


def decompress(file_path, output_file_path):

    f = zipfile.ZipFile(file_path)
    try:
        for file in f.namelist():
            f.extract(file, output_file_path)  # 解压到指定路径下
        f.close()
    except IOError:
        raise
    finally:
        if f:
            f.close()